package com.matrix.java.chap_03;

import java.util.Scanner;

/*
    游戏：猜硬币的正反面
 */
public class Ex3_14 {
    public static void main(String[] args) {
        //生成0或1
        double random = Math.random();
        long round = Math.round(random);

        System.out.print("输入: ");
        Scanner input = new Scanner(System.in);
        int num = input.nextInt();
        if (num == round){
            System.out.println("success");
            return;
        }
        System.out.println("failed");
    }
}
